﻿/*
This is Javascript Library that will let you easy to add data picker in your code.  
*/

/*

Parameters:
    fldName--the first argument (fldName) is a string representing the
name of the field that will be modified if the user picks a data.
    sql--the sql script to get data, must have ID field and Name field.

*/
function ShowDatePicker(fldName,xmlfile,sql) {
    var targetDateField = document.getElementsByName(fldName).item(0);


    var x = targetDateField.offsetLeft;
    var y = targetDateField.offsetTop + targetDateField.offsetHeight;
    var parent = targetDateField;
    while (parent.offsetParent) {
        parent = parent.offsetParent;
        x += parent.offsetLeft;
        y += parent.offsetTop;
    }
    drawDataPicker(targetDateField, x, y);
}

